package com.way.controller;

import com.way.service.DemoService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;

@RequestMapping("/demo")
@RestController
public class DemoController {

    @Resource
    private DemoService demoService;

    @GetMapping("/sayHello/{name}")
    public String sayHello(@PathVariable("name") String name) {
        return demoService.syaHello(name);
    }

    @GetMapping("/mono")
    public Mono<String> mono() {
        return Mono.just("simple string");
    }

}
